package org.deschutter.hibernate;

import javax.persistence.*;

/**
 * User: Berten De Schutter
 * Date: 01-Oct-2009
 * Time: 13:38:25
 */
@Entity
@Table(catalog = "scimitar", name = "galaxies_history")
@IdClass(GalaxiesHistoryPK.class)
public class GalaxiesHistory {
    private int x;

    @Id
    @Column(name = "x")
    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    private int y;

    @Id
    @Column(name = "y")
    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    private String galaxyName;

    @Basic
    @Column(name = "galaxy_name")
    public String getGalaxyName() {
        return galaxyName;
    }

    public void setGalaxyName(String galaxyName) {
        this.galaxyName = galaxyName;
    }

    private int size;

    @Basic
    @Column(name = "size")
    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    private long score;

    @Basic
    @Column(name = "score")
    public long getScore() {
        return score;
    }

    public void setScore(long score) {
        this.score = score;
    }

    private long value;

    @Basic
    @Column(name = "value")
    public long getValue() {
        return value;
    }

    public void setValue(long value) {
        this.value = value;
    }

    private int xp;

    @Basic
    @Column(name = "xp")
    public int getXp() {
        return xp;
    }

    public void setXp(int xp) {
        this.xp = xp;
    }

    private int tick;

    @Id
    @Column(name = "tick")
    public int getTick() {
        return tick;
    }

    public void setTick(int tick) {
        this.tick = tick;
    }

    private int scoreRank;

    @Basic
    @Column(name = "score_rank")
    public int getScoreRank() {
        return scoreRank;
    }

    public void setScoreRank(int scoreRank) {
        this.scoreRank = scoreRank;
    }

    private int sizeRank;

    @Basic
    @Column(name = "size_rank")
    public int getSizeRank() {
        return sizeRank;
    }

    public void setSizeRank(int sizeRank) {
        this.sizeRank = sizeRank;
    }

    private int valueRank;

    @Basic
    @Column(name = "value_rank")
    public int getValueRank() {
        return valueRank;
    }

    public void setValueRank(int valueRank) {
        this.valueRank = valueRank;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GalaxiesHistory that = (GalaxiesHistory) o;

        if (score != that.score) return false;
        if (scoreRank != that.scoreRank) return false;
        if (size != that.size) return false;
        if (sizeRank != that.sizeRank) return false;
        if (tick != that.tick) return false;
        if (value != that.value) return false;
        if (valueRank != that.valueRank) return false;
        if (x != that.x) return false;
        if (xp != that.xp) return false;
        if (y != that.y) return false;
        if (galaxyName != null ? !galaxyName.equals(that.galaxyName) : that.galaxyName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = x;
        result = 31 * result + y;
        result = 31 * result + (galaxyName != null ? galaxyName.hashCode() : 0);
        result = 31 * result + size;
        result = 31 * result + (int) (score ^ (score >>> 32));
        result = 31 * result + (int) (value ^ (value >>> 32));
        result = 31 * result + xp;
        result = 31 * result + tick;
        result = 31 * result + scoreRank;
        result = 31 * result + sizeRank;
        result = 31 * result + valueRank;
        return result;
    }
}
